<template>
  <!-- 待入库 -->
  <template v-if="record.status == 20 && orderType == '1'">
    <a-button type="link" @click="clickEvent('outbound')">出库</a-button>
  </template>

  <!-- 待入库 -->
  <template v-if="record.status == 20 && orderType == '2'">
    <a-button type="link" @click="clickEvent('inbound')">入库</a-button>
  </template>

  <!-- 入库待复核 -->
  <!-- <template v-if="record.status == 70">
    <a-button type="link" @click="clickEvent('inboundCheck')">入库复核</a-button>
  </template> -->
</template>

<script lang="ts" setup>
  import { defineEmits } from 'vue';

  const emit = defineEmits(['clickEvent']);

  const clickEvent = (type) => {
    console.log('🚀 ~ clickEvent ~ type:', type);
    emit('clickEvent', type, props.record);
  };

  // 获取外部传入的数据
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  const props = defineProps({
    record: {
      type: Object,
      default: () => {
        return {};
      },
    },
    orderType: {
      type: String,
      default: '0',
    },
  });
  // console.log('btn', props);
</script>

<style scoped></style>
